<template>
  <van-field 
  :name="myItem.propValues[labelIndex].value" 
  :label="myItem.propValues[labelIndex].value"
  :required="myItem.propValues[requiredIndex].value" >
    <template #input>
      <van-switch v-model="myItem.propValues[modelIndex].value" size="20" @change="changeSwitch" />
    </template>
  </van-field>
</template>
<script>
export default {
  props: {
    myItem: {},
  },
  data() {
    return {
      modelIndex: 0,
      labelIndex: 1,
      requiredIndex: 2,
    }
  },
  methods: {
    changeSwitch(val) {
        console.log(this.myItem.propValues[this.labelIndex].value);
        console.log(val);
    }
  }
};
</script>